/**
 * Copyright 2015-2016 eyaomall.cn
 * All rights reserved.
 *
 * @project
 * @author jackey
 * @version 1.0
 * @date 2016-01-06
 */
package com.eyaomall.wxmall.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.eyaomall.wxmall.model.po.ShoppingChart;
import com.eyaomall.wxmall.model.vo.ShoppingChartVO;
import com.lycheeframework.core.annotation.NameSpace;
import com.lycheeframework.core.cmp.kit.IHTTPObject;
import com.lycheeframework.core.cmp.kit.Pages;
import com.lycheeframework.core.support.DaoSupport;
/**
 * 购物车
 * @author pro
 *
 */
@Repository
@NameSpace("shopping_chart")
public class ShoppingChartDao extends DaoSupport<ShoppingChart> {

	/**
	 * 分页查询购物车数据
	 * @param memberId
	 * @param httpObject
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public Pages<List<ShoppingChartVO>> page(Integer memberId,IHTTPObject httpObject){
		Map<String,Object> data = new HashMap<String,Object>();
		data.put("memberId", memberId);
		
		return (Pages<List<ShoppingChartVO>>) super.page(data,httpObject);
	}
	
	/**
	 * 查询购物车内的数量
	 * @param memberId
	 * @return
	 */
	public Integer count(Integer memberId){
		Map<String,Object> data = new HashMap<String,Object>();
		data.put("memberId", memberId);
		
		return super.count(data);
	}
}
